#ifndef NDEFMANAGER_H
#define NDEFMANAGER_H

#include <QObject>
#include <qnearfieldmanager.h>
#include <qndeffilter.h>
#include <qnearfieldtarget.h>
#include <qndefmessage.h>
#include <qndefrecord.h>
#include <qndefnfcurirecord.h>
#include <qndefnfctextrecord.h>
#include <QUrl>
#include <QDebug>  // we will test first!
QTM_USE_NAMESPACE  // Use Qt Mobility namespace

class NdefManager : public QObject
{
    Q_OBJECT
public:
    explicit NdefManager(QObject *parent = 0);

    ~NdefManager();

signals:
    void nfcReadTagUri(const QUrl& nfcTagUri);
    void nfcReadTagText(const QString& nfcTagText);
    void nfcWriteResult(const bool result);

public slots:
    void nfcWriteUriTag(const QString& nfcTagText);
    void nfcWriteTextTag(const QString& nfcTagText);

private slots:
    void targetLost(QNearFieldTarget *target);
    void targetDetected(QNearFieldTarget *target);
    void targetDetected(const QNdefMessage &message, QNearFieldTarget *target);
    void ndefMessageRead(const QNdefMessage &message);
    void writeSucceed();
    void writeFailed();

private:
    QNearFieldManager *nfcManager;
    QNearFieldTarget *cachedTarget;
};

#endif // NDEFMANAGER_H


